package com.example.administrator.activityandintent1;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Index extends AppCompatActivity {
    Button btn1 = null;
    Button btn2 = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_index);

        btn1 = (Button)findViewById(R.id.example1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Index.this,Button_use.class);
                startActivity(intent);
            }
        });

        btn2 = (Button)findViewById(R.id.example2);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Index.this,Intent_use1.class);
                startActivity(intent);
            }
        });
    }
}


